package com.fzy.auth.action;

import com.fzy.auth.entity.User;
import com.fzy.auth.service.UserService;
import com.fzy.core.BaseAction;
import com.fzy.core.MyValidationAware;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

public class UserInputAction extends BaseAction implements ModelDriven, 
		MyValidationAware, Preparable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2042848465554272624L;
	User user;
	UserService userService;
	String errorDispatch;

	public void prepare() throws Exception {
		errorDispatch = "redirect:userList.do";
		user = (User)validateId(request.getParameter("id"), User.class);
	}

	public void validate() {

	}

	public String execute() throws Exception {
		return "dispatcher:/WEB-INF/jsp/auth/user-input.jsp";
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public User getUser() {
		return user;
	}

	public Object getModel() {
		return user;
	}

	public String getErrorDispatch() {
		return errorDispatch;
	}

}
